//
//  YWReplyManager.h
//  maintain
//
//  Created by Kyo on 16/6/29.
//  Copyright © 2016年 ewin. All rights reserved.
//

#import "YWReply.h"
#import "YWSingleton.h"
#import <Foundation/Foundation.h>

@interface YWReplyManager : NSObject
YWSingletonH(Manager)

    /**
 *  保存更新评论
 *
 *  @param Replys 回复数组
 *
 *  @return 结果
 */
    - (BOOL)updateReplyWithReplyArray : (NSArray*)replyArray;
/**
 *  更新评论的已读状态
 *
 *  @param relationType 类型
 *
 *  @return 结果
 */
- (BOOL)updateReplyIsReadWithType:(YWReplyRelationType)relationType;
/**
 *  删除评论
 *
 *  @param replyId 评论id
 *
 *  @return 结果
 */
- (BOOL)deleteReplyWithReplyId:(NSInteger)replyId;
/**
 *  获取某条数据的评论
 *
 *  @param relationId 关联id
 *
 *  @return 结果
 */
- (NSArray*)replysWithtRelationId:(NSInteger)relationId andRelationType:(NSInteger)relationType;
/**
 *  获取未读的评论
 *
 *  @param relationType 关联类型
 *
 *  @return 结果
 */
- (NSArray*)noReadReplysWithRelationType:(YWReplyRelationType)relationType;
/**
 *   查询未读的评论的数量
 *
 *  @param relationType 关联类型
 *
 *  @return 结果
 */
- (NSInteger)noReadReplysCountWithRelationType:(YWReplyRelationType)relationType;
/**
 *   查询关联的评论的数量
 *
 *  @param relationId 关联id
 *  @param relationType 关联类型
 *
 *  @return 结果
 */
- (NSInteger)replysCountWithtRelationId:(NSInteger)relationId relationType:(YWReplyRelationType)relationType;
/**
 *  提交评论
 *
 *  @param reply reply
 *
 *  @return 无
 */
- (void)commitReplys:(YWReply*)reply url:(NSString*)url WithComplete:(void (^)(BOOL success))complete;

/**
 *  获取评论
 *
 *  @param relationId 关联relationId
 *
 *  @return 无
 */
- (void)requestReplysWithRelationId:(NSString*)relationId type:(NSInteger)type WithComplete:(void (^)(BOOL success))complete;

@end
